package socketmvc.core.packets.biz;

import socketmvc.core.packets.PacketStaticFactory;
import socketmvc.core.packets.basic.IPacket;
import socketmvc.core.packets.basic.JsonBasicPacket;

public class TextMessage implements IMessage<String>{

    protected String msgId;

    protected Integer cmd;

    protected Long createTime;

    protected String msgContext;

    @Override
    public String getId() {
        return msgId;
    }

    @Override
    public Integer getType() {
        return 0;
    }

    @Override
    public Long getCreateAt() {
        return createTime;
    }

    @Override
    public String getContent() {
        return msgContext;
    }

    @Override
    public IPacket toPacket(String cmd) {
        JsonBasicPacket packet = PacketStaticFactory.createSimplePacket(this);
        packet.setCommand(cmd);
        return packet;
    }
}
